package com.lb.jwitter.service;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lb.jwitter.*;
import com.lb.jwitter.hibernate.*;
import com.lb.jwitter.util.ConditionReport;

@Service("tbl_ThongTin_TKB_ChiTietService")
@Transactional
@WebService(endpointInterface = "com.lb.jwitter.service.Tbl_ThongTin_TKB_ChiTietService")
public class Tbl_ThongTin_TKB_ChiTietServiceImpl implements Tbl_ThongTin_TKB_ChiTietService,Serializable {

   private Log log = LogFactory.getLog(Tbl_ThongTin_TKB_ChiTietServiceImpl.class);
   private static final long serialVersionUID = -8740095022264495229L;

   @Autowired
   @Qualifier("tbl_ThongTin_TKB_ChiTietDAO")
   private Tbl_ThongTin_TKB_ChiTietDAO _tbl_ThongTin_TKB_ChiTietDao;

   @Autowired
   @Qualifier("tbl_ThongTin_TKBDAO")
   private Tbl_ThongTin_TKBDAO _tbl_ThongTin_TKBDao;

   @Autowired
   @Qualifier("tbl_CTDT_DM_PhongDAO")
   private Tbl_CTDT_DM_PhongDAO _tbl_CTDT_DM_PhongDao;

   @Autowired
   @Qualifier("tbl_CTDT_DM_NgayTrongTuanDAO")
   private Tbl_CTDT_DM_NgayTrongTuanDAO _tbl_CTDT_DM_NgayTrongTuanDao;

   @Autowired
   @Qualifier("tbl_CTDT_DM_TietHocDAO")
   private Tbl_CTDT_DM_TietHocDAO _tbl_CTDT_DM_TietHocDao;

   public final List<Tbl_ThongTin_TKB_ChiTiet> findAlltbl_ThongTin_TKB_ChiTiet(int pageSize, int page){
   List<Tbl_ThongTin_TKB_ChiTiet> result = get_tbl_ThongTin_TKB_ChiTietDao().findAll(pageSize, page);
       log.info("Number of user in DB:: "+result.size());
       return result;
   }

   @Transactional(noRollbackFor=IllegalArgumentException.class)
   public final Long createtbl_ThongTin_TKB_ChiTiet(Tbl_ThongTin_TKB_ChiTiet obj){
       return _tbl_ThongTin_TKB_ChiTietDao.save(obj);
   }

   public final void updatetbl_ThongTin_TKB_ChiTiet(Tbl_ThongTin_TKB_ChiTiet obj){
       _tbl_ThongTin_TKB_ChiTietDao.update(obj);
   }//end update methode

   public final Tbl_ThongTin_TKB_ChiTiet gettbl_ThongTin_TKB_ChiTiet (Long id){
       log.info("Try to retrieve the tbl_ThongTin_TKB_ChiTiet: "+id);
       return get_tbl_ThongTin_TKB_ChiTietDao().get(id);
   }

   public void deletetbl_ThongTin_TKB_ChiTiet(Long id){
       log.info("Try to delete the tbl_ThongTin_TKB_ChiTiet by Id : "+ id);
       if(_tbl_ThongTin_TKB_ChiTietDao.exists(id)){
	    _tbl_ThongTin_TKB_ChiTietDao.delete(id);
       } else {
       	throw new IllegalArgumentException("EmployeeId '"+id+"' does not exists");
       }
   }

   public void deleteListtbl_ThongTin_TKB_ChiTiet(String[] listId){
       for(String id : listId){
   	    deletetbl_ThongTin_TKB_ChiTiet(Long.parseLong(id));
       }
   }

   public List<Tbl_ThongTin_TKB_ChiTiet> findtbl_ThongTin_TKB_ChiTietByCondition(List<ConditionReport> cons,int pageSize,int page){ 
       return _tbl_ThongTin_TKB_ChiTietDao.findByCondition(Tbl_ThongTin_TKB_ChiTiet.class, cons, pageSize, page); 
   } 
 
   public int counttbl_ThongTin_TKB_ChiTietByCondition(List<ConditionReport> cons){ 
       return _tbl_ThongTin_TKB_ChiTietDao.countByCondition(Tbl_ThongTin_TKB_ChiTiet.class, cons); 
   } 
 
   public final Tbl_ThongTin_TKB_ChiTietDAO get_tbl_ThongTin_TKB_ChiTietDao() {
   	return _tbl_ThongTin_TKB_ChiTietDao;
   }
   public final void set_tbl_ThongTin_TKB_ChiTietDao(Tbl_ThongTin_TKB_ChiTietDAO obj) {
   	this._tbl_ThongTin_TKB_ChiTietDao = obj;
   }

   public Tbl_ThongTin_TKBDAO get_tbl_ThongTin_TKBDao() {
       return _tbl_ThongTin_TKBDao;
   }
   public void set_tbl_ThongTin_TKBDao(Tbl_ThongTin_TKBDAO _tbl_ThongTin_TKBDao) {
       this._tbl_ThongTin_TKBDao = _tbl_ThongTin_TKBDao;
   }

   public Tbl_CTDT_DM_PhongDAO get_tbl_CTDT_DM_PhongDao() {
       return _tbl_CTDT_DM_PhongDao;
   }
   public void set_tbl_CTDT_DM_PhongDao(Tbl_CTDT_DM_PhongDAO _tbl_CTDT_DM_PhongDao) {
       this._tbl_CTDT_DM_PhongDao = _tbl_CTDT_DM_PhongDao;
   }

   public Tbl_CTDT_DM_NgayTrongTuanDAO get_tbl_CTDT_DM_NgayTrongTuanDao() {
       return _tbl_CTDT_DM_NgayTrongTuanDao;
   }
   public void set_tbl_CTDT_DM_NgayTrongTuanDao(Tbl_CTDT_DM_NgayTrongTuanDAO _tbl_CTDT_DM_NgayTrongTuanDao) {
       this._tbl_CTDT_DM_NgayTrongTuanDao = _tbl_CTDT_DM_NgayTrongTuanDao;
   }

   public Tbl_CTDT_DM_TietHocDAO get_tbl_CTDT_DM_TietHocDao() {
       return _tbl_CTDT_DM_TietHocDao;
   }
   public void set_tbl_CTDT_DM_TietHocDao(Tbl_CTDT_DM_TietHocDAO _tbl_CTDT_DM_TietHocDao) {
       this._tbl_CTDT_DM_TietHocDao = _tbl_CTDT_DM_TietHocDao;
   }

}//endclass

